package com.mauroleon.promotail.component;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mauroleon.promotail.domain.Categoria;
import com.mauroleon.promotail.service.CategoriaService;

@Component
@Path("/categorias")
public class CategoriaResourceComponent {

	@Autowired
	private CategoriaService categoriaService;

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public List<Categoria> obtenerCategorias() {
		return categoriaService.findAll();
	}

}
